package zhupf.test.designPattern.adapter.classAdapter;

import java.util.HashMap;
import java.util.Map;

/**
 *  适配器类  这个类就相当于  HandlerAdapter 接口的实现类， HttpRequestHandlerAdapter
 */
//public class VoltageAdapter extends Voltage220V implements Voltage5V {
public class VoltageAdapter  implements Voltage5V {

    // 这边就相当于 Voltage220V 为controller
    private Voltage220V voltage220V = new Voltage220V();

    @Override
    public int handler() {
        int src = voltage220V.outPut220();
       int targ =  src/44;
        System.out.println("输出"+targ+"电压");
        Map map = new HashMap();
        map.put(1,1);
        return targ;
    }
}
